package cn.shyouchi.wuguanjia.android.ui.patrol.statistic;


import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Eenie on 2016/12/29 at 12:33
 * Email: 472279981@qq.com
 * Des:
 */

public class PatrolStatisticEntity {

    /**
     * resultCode : 0
     * resultMessage : [{"date":"2017-01-10","rate":{"turn":1,"turn_total":2,"turn_actual":2,"number":0.5,"number_actual":1},"info":[{"inspection":[{"id":34,"situation":0,"time":"17:19:56","inspectionname":"测","image":[{"image":"/images/inspection/20170110/20170110172007YC298030304.jpg"}],"happening":"异常","warranty":{"id":30,"uniqueid":"YC201701101719567498","title":"异常标题","content":"异常内容","inspectionpoint_id":80,"image":[{"image":"/images/inspection/20170110/20170110171956YC1892929250.jpg"},{"image":"/images/inspection/20170110/20170110171956YC1350920406.jpg"}]}}]}],"user":{"name":"唐海斌","id_card_head_image":"/images/user/20161104/20161104014632YC954564236.jpg"}}]
     */

    private int resultCode;
    private List<ResultMessageBean> resultMessage;

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    public List<ResultMessageBean> getResultMessage() {
        return resultMessage;
    }

    public void setResultMessage(List<ResultMessageBean> resultMessage) {
        this.resultMessage = resultMessage;
    }

    public static class ResultMessageBean implements Parcelable {
        /**
         * date : 2017-01-10
         * rate : {"turn":1,"turn_total":2,"turn_actual":2,"number":0.5,"number_actual":1}
         * info : [{"inspection":[{"id":34,"situation":0,"time":"17:19:56","inspectionname":"测","image":[{"image":"/images/inspection/20170110/20170110172007YC298030304.jpg"}],"happening":"异常","warranty":{"id":30,"uniqueid":"YC201701101719567498","title":"异常标题","content":"异常内容","inspectionpoint_id":80,"image":[{"image":"/images/inspection/20170110/20170110171956YC1892929250.jpg"},{"image":"/images/inspection/20170110/20170110171956YC1350920406.jpg"}]}}]}]
         * user : {"name":"唐海斌","id_card_head_image":"/images/user/20161104/20161104014632YC954564236.jpg"}
         */

        private String date;
        private RateBean rate;
        private UserBean user;
        private List<InfoBean> info;

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }

        public RateBean getRate() {
            return rate;
        }

        public void setRate(RateBean rate) {
            this.rate = rate;
        }

        public UserBean getUser() {
            return user;
        }

        public void setUser(UserBean user) {
            this.user = user;
        }

        public List<InfoBean> getInfo() {
            return info;
        }

        public void setInfo(List<InfoBean> info) {
            this.info = info;
        }

        public static class RateBean implements Parcelable {

            /**
             * turn : 0
             * turn_total : 4
             * turn_actual : 0
             * number : 0
             * number_actual : 0
             * ring : 2
             * turn_ring : 0
             */

            private int turn;
            private int turn_total;
            private int turn_actual;
            private int number;
            private int number_actual;
            private int ring;
            private int turn_ring;

            public int getTurn() {
                return turn;
            }

            public void setTurn(int turn) {
                this.turn = turn;
            }

            public int getTurn_total() {
                return turn_total;
            }

            public void setTurn_total(int turn_total) {
                this.turn_total = turn_total;
            }

            public int getTurn_actual() {
                return turn_actual;
            }

            public void setTurn_actual(int turn_actual) {
                this.turn_actual = turn_actual;
            }

            public int getNumber() {
                return number;
            }

            public void setNumber(int number) {
                this.number = number;
            }

            public int getNumber_actual() {
                return number_actual;
            }

            public void setNumber_actual(int number_actual) {
                this.number_actual = number_actual;
            }

            public int getRing() {
                return ring;
            }

            public void setRing(int ring) {
                this.ring = ring;
            }

            public int getTurn_ring() {
                return turn_ring;
            }

            public void setTurn_ring(int turn_ring) {
                this.turn_ring = turn_ring;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(this.turn);
                dest.writeInt(this.turn_total);
                dest.writeInt(this.turn_actual);
                dest.writeInt(this.number);
                dest.writeInt(this.number_actual);
                dest.writeInt(this.ring);
                dest.writeInt(this.turn_ring);
            }

            public RateBean() {
            }

            protected RateBean(Parcel in) {
                this.turn = in.readInt();
                this.turn_total = in.readInt();
                this.turn_actual = in.readInt();
                this.number = in.readInt();
                this.number_actual = in.readInt();
                this.ring = in.readInt();
                this.turn_ring = in.readInt();
            }

            public static final Creator<RateBean> CREATOR = new Creator<RateBean>() {
                @Override
                public RateBean createFromParcel(Parcel source) {
                    return new RateBean(source);
                }

                @Override
                public RateBean[] newArray(int size) {
                    return new RateBean[size];
                }
            };
        }

        public static class UserBean implements Parcelable {
            /**
             * name : 唐海斌
             * id_card_head_image : /images/user/20161104/20161104014632YC954564236.jpg
             */

            private int id;
            private String name;
            private String id_card_head_image;

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getId_card_head_image() {
                return id_card_head_image;
            }

            public void setId_card_head_image(String id_card_head_image) {
                this.id_card_head_image = id_card_head_image;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(this.id);
                dest.writeString(this.name);
                dest.writeString(this.id_card_head_image);
            }

            public UserBean() {
            }

            protected UserBean(Parcel in) {
                this.id = in.readInt();
                this.name = in.readString();
                this.id_card_head_image = in.readString();
            }

            public static final Creator<UserBean> CREATOR = new Creator<UserBean>() {
                @Override
                public UserBean createFromParcel(Parcel source) {
                    return new UserBean(source);
                }

                @Override
                public UserBean[] newArray(int size) {
                    return new UserBean[size];
                }
            };
        }

        public static class InfoBean implements Parcelable {
            private List<InspectionBean> inspection;

            public List<InspectionBean> getInspection() {
                return inspection;
            }

            public void setInspection(List<InspectionBean> inspection) {
                this.inspection = inspection;
            }

            public static class InspectionBean implements Parcelable {
                /**
                 * id : 34
                 * situation : 0
                 * time : 17:19:56
                 * inspectionname : 测
                 * image : [{"image":"/images/inspection/20170110/20170110172007YC298030304.jpg"}]
                 * happening : 异常
                 * warranty : {"id":30,"uniqueid":"YC201701101719567498","title":"异常标题","content":"异常内容","inspectionpoint_id":80,"image":[{"image":"/images/inspection/20170110/20170110171956YC1892929250.jpg"},{"image":"/images/inspection/20170110/20170110171956YC1350920406.jpg"}]}
                 */

                private int id;
                private int situation;
                private String time;
                private String inspectionname;
                private String happening;
                private WarrantyBean warranty;
                private List<ImageBeanX> image;

                public int getId() {
                    return id;
                }

                public void setId(int id) {
                    this.id = id;
                }

                public int getSituation() {
                    return situation;
                }

                public void setSituation(int situation) {
                    this.situation = situation;
                }

                public String getTime() {
                    return time;
                }

                public void setTime(String time) {
                    this.time = time;
                }

                public String getInspectionname() {
                    return inspectionname;
                }

                public void setInspectionname(String inspectionname) {
                    this.inspectionname = inspectionname;
                }

                public String getHappening() {
                    return happening;
                }

                public void setHappening(String happening) {
                    this.happening = happening;
                }

                public WarrantyBean getWarranty() {
                    return warranty;
                }

                public void setWarranty(WarrantyBean warranty) {
                    this.warranty = warranty;
                }

                public List<ImageBeanX> getImage() {
                    return image;
                }

                public void setImage(List<ImageBeanX> image) {
                    this.image = image;
                }

                public static class WarrantyBean implements Parcelable {
                    /**
                     * id : 30
                     * uniqueid : YC201701101719567498
                     * title : 异常标题
                     * content : 异常内容
                     * inspectionpoint_id : 80
                     * image : [{"image":"/images/inspection/20170110/20170110171956YC1892929250.jpg"},{"image":"/images/inspection/20170110/20170110171956YC1350920406.jpg"}]
                     */

                    private int id;
                    private String uniqueid;
                    private String title;
                    private String content;
                    private int inspectionpoint_id;
                    private List<ImageBean> image;

                    public int getId() {
                        return id;
                    }

                    public void setId(int id) {
                        this.id = id;
                    }

                    public String getUniqueid() {
                        return uniqueid;
                    }

                    public void setUniqueid(String uniqueid) {
                        this.uniqueid = uniqueid;
                    }

                    public String getTitle() {
                        return title;
                    }

                    public void setTitle(String title) {
                        this.title = title;
                    }

                    public String getContent() {
                        return content;
                    }

                    public void setContent(String content) {
                        this.content = content;
                    }

                    public int getInspectionpoint_id() {
                        return inspectionpoint_id;
                    }

                    public void setInspectionpoint_id(int inspectionpoint_id) {
                        this.inspectionpoint_id = inspectionpoint_id;
                    }

                    public List<ImageBean> getImage() {
                        return image;
                    }

                    public void setImage(List<ImageBean> image) {
                        this.image = image;
                    }

                    public static class ImageBean implements Parcelable {
                        /**
                         * image : /images/inspection/20170110/20170110171956YC1892929250.jpg
                         */

                        private String image;

                        public String getImage() {
                            return image;
                        }

                        public void setImage(String image) {
                            this.image = image;
                        }

                        @Override
                        public int describeContents() {
                            return 0;
                        }

                        @Override
                        public void writeToParcel(Parcel dest, int flags) {
                            dest.writeString(this.image);
                        }

                        public ImageBean() {
                        }

                        protected ImageBean(Parcel in) {
                            this.image = in.readString();
                        }

                        public static final Parcelable.Creator<ImageBean> CREATOR = new Parcelable.Creator<ImageBean>() {
                            @Override
                            public ImageBean createFromParcel(Parcel source) {
                                return new ImageBean(source);
                            }

                            @Override
                            public ImageBean[] newArray(int size) {
                                return new ImageBean[size];
                            }
                        };
                    }

                    @Override
                    public int describeContents() {
                        return 0;
                    }

                    @Override
                    public void writeToParcel(Parcel dest, int flags) {
                        dest.writeInt(this.id);
                        dest.writeString(this.uniqueid);
                        dest.writeString(this.title);
                        dest.writeString(this.content);
                        dest.writeInt(this.inspectionpoint_id);
                        dest.writeTypedList(this.image);
                    }

                    public WarrantyBean() {
                    }

                    protected WarrantyBean(Parcel in) {
                        this.id = in.readInt();
                        this.uniqueid = in.readString();
                        this.title = in.readString();
                        this.content = in.readString();
                        this.inspectionpoint_id = in.readInt();
                        this.image = in.createTypedArrayList(ImageBean.CREATOR);
                    }

                    public static final Parcelable.Creator<WarrantyBean> CREATOR = new Parcelable.Creator<WarrantyBean>() {
                        @Override
                        public WarrantyBean createFromParcel(Parcel source) {
                            return new WarrantyBean(source);
                        }

                        @Override
                        public WarrantyBean[] newArray(int size) {
                            return new WarrantyBean[size];
                        }
                    };
                }

                public static class ImageBeanX implements Parcelable {
                    /**
                     * image : /images/inspection/20170110/20170110172007YC298030304.jpg
                     */

                    private String image;

                    public String getImage() {
                        return image;
                    }

                    public void setImage(String image) {
                        this.image = image;
                    }

                    @Override
                    public int describeContents() {
                        return 0;
                    }

                    @Override
                    public void writeToParcel(Parcel dest, int flags) {
                        dest.writeString(this.image);
                    }

                    public ImageBeanX() {
                    }

                    protected ImageBeanX(Parcel in) {
                        this.image = in.readString();
                    }

                    public static final Parcelable.Creator<ImageBeanX> CREATOR = new Parcelable.Creator<ImageBeanX>() {
                        @Override
                        public ImageBeanX createFromParcel(Parcel source) {
                            return new ImageBeanX(source);
                        }

                        @Override
                        public ImageBeanX[] newArray(int size) {
                            return new ImageBeanX[size];
                        }
                    };
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel dest, int flags) {
                    dest.writeInt(this.id);
                    dest.writeInt(this.situation);
                    dest.writeString(this.time);
                    dest.writeString(this.inspectionname);
                    dest.writeString(this.happening);
                    dest.writeParcelable(this.warranty, flags);
                    dest.writeTypedList(this.image);
                }

                public InspectionBean() {
                }

                protected InspectionBean(Parcel in) {
                    this.id = in.readInt();
                    this.situation = in.readInt();
                    this.time = in.readString();
                    this.inspectionname = in.readString();
                    this.happening = in.readString();
                    this.warranty = in.readParcelable(WarrantyBean.class.getClassLoader());
                    this.image = in.createTypedArrayList(ImageBeanX.CREATOR);
                }

                public static final Parcelable.Creator<InspectionBean> CREATOR = new Parcelable.Creator<InspectionBean>() {
                    @Override
                    public InspectionBean createFromParcel(Parcel source) {
                        return new InspectionBean(source);
                    }

                    @Override
                    public InspectionBean[] newArray(int size) {
                        return new InspectionBean[size];
                    }
                };
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeTypedList(this.inspection);
            }

            public InfoBean() {
            }

            protected InfoBean(Parcel in) {
                this.inspection = in.createTypedArrayList(InspectionBean.CREATOR);
            }

            public static final Parcelable.Creator<InfoBean> CREATOR = new Parcelable.Creator<InfoBean>() {
                @Override
                public InfoBean createFromParcel(Parcel source) {
                    return new InfoBean(source);
                }

                @Override
                public InfoBean[] newArray(int size) {
                    return new InfoBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.date);
            dest.writeParcelable(this.rate, flags);
            dest.writeParcelable(this.user, flags);
            dest.writeTypedList(this.info);
        }

        public ResultMessageBean() {
        }

        protected ResultMessageBean(Parcel in) {
            this.date = in.readString();
            this.rate = in.readParcelable(RateBean.class.getClassLoader());
            this.user = in.readParcelable(UserBean.class.getClassLoader());
            this.info = in.createTypedArrayList(InfoBean.CREATOR);
        }

        public static final Parcelable.Creator<ResultMessageBean> CREATOR = new Parcelable.Creator<ResultMessageBean>() {
            @Override
            public ResultMessageBean createFromParcel(Parcel source) {
                return new ResultMessageBean(source);
            }

            @Override
            public ResultMessageBean[] newArray(int size) {
                return new ResultMessageBean[size];
            }
        };
    }
}
